package com.matrix.draft.sockettest.groupchatroom.client;

import java.util.Random;
import java.util.Scanner;

public class ClientApplication {
    public static void main(String[] args) {
        Random random = new Random();
        Scanner sc = new Scanner(System.in);

        String username = "Client"+random.nextInt(100);
        GroupChatClient client = new GroupChatClient(username);
        client.listenEvent(); // 开始监听事件发生

        // 开始在键盘输入聊天消息
        while (true){
            String msg = sc.nextLine();
            client.doSend(msg);
        }
    }
}
